<template>
	<view class="content">
		<view class="list tn-flex tn-flex-wrap"  :class="show ? 'fade-in' : 'fade-out'">
			<block v-for="(item,index) in list" :key="index">
				<view class="li tn-flex tn-flex-direction-column tn-flex-col-center" @click="goList(item.id,item.name)">
					<image :src="item.img" mode=""></image>
					<text>{{item.name}}</text>
				</view>
			</block>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[],
				show:false
			};
		},
		onLoad() {
			this.getList()
		},
		methods:{
			getList(){
				this.$request({
					loading:1,
					method: 'post',
					url: '/api/play_game/game',
				}).then(res =>{
					this.list = res.data.data
					this.show = true
				})
			},
			goList(id,name){
				uni.navigateTo({
					// url:"/homePages/manito-list?id="+id
					url:`/homePages/manito-list?id=${id}&name=${name}`
				})
			}
		}
	}
</script>
<style lang="scss">
	page{
		background-color: $uni-bg-color;
	}
</style>
<style lang="scss" scoped>
.content{
	padding: 30rpx;
	.list{
		background: #efefef;
		border-radius: 20rpx;
		padding-top: 56rpx;
		.li{
			width: 33%;
			margin-bottom: 56rpx;
			image{
				width: 88rpx;
				height: 88rpx;

			}
			text{
				font-size: 28rpx;
				font-weight: 400;
				color: #333333;
				margin-top: 16rpx;
			}
		}
	}
}
</style>
